<?php 
class Ext_Validator 
{
    public static function isIsbn( $isbn, $len )
    {
  	if (strlen(self::clean_isbn($isbn, $len)) != $len) {
	    return false;
	}
        return true;
    }
    public static function clean_isbn($isbn, $len)
    {
   	$isbn = str_replace('-', '', trim( $isbn ));
 	$isbn = str_replace(' ', '', trim( $isbn ));
 	if ( strlen( $isbn ) != $len ) {
  	    return null;
	}
	return $isbn;
    }
}
